/**
 *@Author: QWP
 *@Description: 聊天相关接口
 *@Date 2024-08-06 19:04
 */
import request from "@/http";

// 查询当前登陆人聊天信息
export const getMessage = async (data: object) => {
  return await request.post({
    url: "/api/bizz/tChattingrecords/getMessage",
    data: data,
    headersType: "application/x-www-form-urlencoded",
  });
};

// 发送聊天信息
export const sendMessage = async (data: object) => {
  return await request.post({
    url: "/api/bizz/tChattingrecords/sendMessage",
    data: data,
    // headersType: 'application/x-www-form-urlencoded'
  });
};

// 撤回信息
export const recallMessage = async (data: object) => {
  return await request.post({
    url: "/api/bizz/tChattingrecords/recallMessage",
    data: data,
  });
};

// 设置置顶
export const setStatus = async (data: object) => {
  return await request.put({
    url: "/api/bizz/tChatBar/setStatus",
    data: data,
    // headersType: 'application/x-www-form-urlencoded'
  });
};

// 设置消息已读
export const read = async (data: object) => {
  return await request.post({
    url: "/api/bizz/tChattingrecords/read",
    data: data,
  });
};

// 点击列表，打开聊天
export const openMessage = async (data: object) => {
  return await request.post({
    url: "/api/bizz/tChattingrecords/openMessage",
    data: data,
    // headersType: 'application/x-www-form-urlencoded'
  });
};
